package com.example.springboottest.student.controller;


import com.example.springboottest.student.entity.StudentCourseEntity;
import com.example.springboottest.student.service.StudentCourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/score")
public class StudentCourseController {

    @Autowired
    StudentCourseService studentCourseService;

    @RequestMapping("/findById/{s_id}")
    public List<StudentCourseEntity> findById(@PathVariable("s_id") Integer s_id){
            return  studentCourseService.findById(s_id);
    }

    @PostMapping("/save")
    @ResponseBody
    public String save(@RequestBody StudentCourseEntity studentCourseEntity){
        studentCourseService.save(studentCourseEntity);
        return "success";
    }
}
